atan2
Arctangle of two parameters
atan2()
function returns the arctangent of two parameters, with the return value being radians, whose value is between -PI and PI (including -PI and PI).
This example calculates the arctangent value of different variables x and y:
<?php echo ( atan2 ( 0.50 , 0.50 ) ) ; echo ( atan2 ( - 0.50 , - 0.50 ) ) ; echo ( atan2 ( 5 , 5 ) ) ; echo ( atan2 ( 10 , 20 ) ) ; echo ( atan2 ( - 5 , - 5 ) ) ; echo ( atan2 ( - 10 , 10 ) ) ?>
Try it yourself
atan2( x , y )
parameter | describe |
---|---|
x | Required. A number. |
y | Required. A number. |
atan2()
function calculates the arctangent value of two variables x and y . Similar to calculating the arctangent tangent of y/x, the difference is that the symbol of the two parameters is used to determine the result outside the quadrant.